package nf.service;

import java.util.List;

import nf.dao.UserDao;
import nf.dao.UserDaoImplJDBC;
import nf.entity.User;

public class UserServiceImpl implements UserService {

	private UserDao userDao = new UserDaoImplJDBC();
	
	@Override
	public int getCount() {
		
		return userDao.getCount();
	}

	@Override
	public List<User> getUserList(int startIndex, int endIndex) {
		List<User> userList = userDao.getUserList(startIndex, endIndex);
		for (User user : userList){
			if (   user.getSex_int()== 1  ){
				user.setSex("男");
			}else if (  user.getSex_int()==0  ){
				user.setSex("女");
			}else{
				user.setSex("真不知道");
			}
		}
		return userList;
	}

}
